﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style>
td {font-size:12px;padding-left:5px;height:18;font-family:Verdana}
body{cursor:default;margin:0;border:1px solid #000000;}
</style>
<script>
	var parentObject		= null;
	var _jEditor			= null;

	document.onselectstart	= function(){return false;}

	document.onmouseover	= over;
	document.onmouseout		= out;

	document.onmousedown	= start;
	document.onmouseup		= chooseLanguage;

	window.onfocus			= resize;
	window.onblur			= kill;

	function over()
	{	
		if(event.srcElement.tagName=='TD' && event.srcElement.value!=_jEditor.language)
		{
			event.srcElement.style.cssText	= 'background-color:highlight;color:white';
		}
	}
	function out()
	{	
		if(event.srcElement.tagName=='TD' && event.srcElement.value!=_jEditor.language)
		{
			event.srcElement.style.cssText	= 'background-color:white;color:black';
		}
	}

	function start()
	{
		iTable.setCapture();
	}

	function chooseLanguage()
	{	
		if(event.srcElement.tagName=='TD' && _jEditor!=null && event.srcElement.value!=_jEditor.language)
		{
			_jEditor.language	= event.srcElement.value;
		}
		iTable.releaseCapture();
		kill();
	}

	function kill()
	{
		if(parentObject.parentElement!=null)
		{
			parentObject.parentElement.activeState	= false;
			parentObject.parentElement.buttonState	= 'out';
			parentObject.style.visibility			= 'hidden';
		}
	}

	function resize()
	{	
		parentObject.style.width	= document.body.scrollWidth;
		parentObject.style.height	= document.body.scrollHeight;

		for(var i=0;i<iTable.rows.length;i++)
		{
			if(iTable.rows(i).cells(0).value==_jEditor.language)
			{
				iTable.rows(i).cells(0).style.cssText	= 'background-color:highlight;color:white';
				break;
			}
		}
	}

	function public_init(e)
	{
		parentObject				= e;
		_jEditor					= parent.document.all(e.ancestor);
		self.focus();
	}
</script>
</HEAD>

<BODY>
<table width=130 border=0 cellspacing=0 cellpadding=0 id=iTable>
<tr>
<td value=cn>简体中文(GB2312)</td>
</tr>
<tr>
<td value=en>English</td>
</tr>
</table>
</BODY>
</HTML>
